<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>SpringMVC Demo</title>
    <link rel="stylesheet" type="text/css" href="css/demo.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js"></script>
<style type="text/css">
    a:link{color:blue}
    a:visited{color:black}
</style>
</head>
<body>

<br/>
<!--<div>-->
<!--    <a href="http://localhost:8080/springmvc/hello-xml">ByXML</a>-->
<!--    <a href="http://localhost:8080/springmvc/hello-annotation">ByAnnotation</a>-->
<!--</div>-->
<div class="leftpart">
    <h3>&emsp;Spring MVC Demo</h3>
    <div class="marginleft">
        <a href="http://localhost:8080/springmvc/controller">1.Controller Demo</a>
    </div>
    <div class="marginleft">
<!--        <a href="http://localhost:8080/springmvc/service">2.Service Demo</a>-->
        <a href="javascript:void(0)" onclick="startService()">2.Service Demo </a>
    </div>
    <div class="marginleft">
        <a href="javascript:void(0)" onclick="startDao(1)">3.Dao Demo---JDBC Template </a>
    </div>
    <div class="marginleft">
        <a href="javascript:void(0)" onclick="startDao(2);return false">4.Dao Demo---mybatis</a>
    </div>
    <div class="marginleft">
        <a href="http://localhost:8080/springmvc/interceptor">5.Interceptor Demo(请启用interceptorContext.xml)</a>
    </div>
</div>

<div id="detail" class="rightpart">

</div>
    <div id="main" class="middlepart">
<!--        <p>Sub Menu</p>-->
    </div>
<br/>
<br/>
<br/>
<div id="result" class="container">
<!--    <p>Result</p>-->
</div>

    <script type="text/javascript">
        function startService() {
              $("#result").html("")
              $.get("http://localhost:8080/springmvc/service",function(data,status){
                  $("#main").html(data)
              });

        }

        function startDao(num) {
            $("#result").html("")
            if(num==1){
            $.get("http://localhost:8080/springmvc/jdbctemplate",function(data,status){
                $("#main").html(data)

            });}
            else{
                $.get("http://localhost:8080/springmvc/mybatis",function(data,status){
                    $("#main").html(data)
                });
            }
        }
    </script>
</body>
</html>